package zeno.project.springboot.jms;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Service;

/**
 * @author ZhiYong
 * @ClassName TopicConsumer2.java
 * @Description Topic消息消费者2
 * @createTime 2021/04/17 17:17:00
 */
@Service
public class TopicConsumer2 {
    /**
     * 接收订阅消息
     * @param msg 消息
     */
    @JmsListener(destination = ActiveMqConfig.TOPIC_NAME, containerFactory = "topicListenerContainer")
    public void receiveTopicMsg(String msg) {
        System.out.println("Topic消息消费者2收到的消息为：" + msg);
    }
}
